<?php if (! defined('BASEPATH')) exit('No direct script access allowed');
class Group extends Controller{
	//建立表映射
	var $controller= "group";
	
	function Group(){
		parent::Controller();
		$this->load->model('crud');
		$this->load->model('display');
		$this->data = $this->display->data;
	}
	
	function index(){
		echo 'Group';
	}
	/* 创建 */	
	function group_new($data= NULL,$id = NULL)
	{
		$this->data['mytitle'] = 'Add New Group';		
		//加载视图 
		$this->display->dashboard($this->data);	
		$this->crud->save($this->controller, $id,'no','group_new'); 			
	}
	/* 读取列表 */
	function group_list(){		
		$this->data['mytitle'] = 'Group List';
		//加载视图
		$fields = 'id,name,description,created,modified';
		$header = array('Group Id','Group Name','Description','Create Time','Modifiy Time','Detail');
		$this->display->dashboard($this->data);	
		$this->crud->read($this->controller,$fields,'','no','group_list',$header);		
	}
	/* 查看详情 */
	function group_view(){
		
	}
	/* 处理 */
	function interim(){
		$this->data['mytitle'] = 'Edit Group';		
		//加载视图 
		$this->display->dashboard($this->data);
		$this->crud->insert($this->controller, $_POST,'no','group_new');  		
	}
	/* 管理 */
	function group_manage(){
		
	}
	
	/* 删除 */
	function group_del($id=NULL){
		
	}
}
?>